<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Animations</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
<link rel="home" href="index.html" title="The gdk-pixbuf Library">
<link rel="up" href="rn01.html" title="API Reference">
<link rel="prev" href="gdk-pixbuf-util.html" title="Utilities">
<link rel="next" href="GdkPixbufLoader.html" title="GdkPixbufLoader">
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="reference" href="rn01.html" title="API Reference">
<link rel="reference" href="rn02.html" title="Tools Reference">
<link rel="index" href="api-index-full.html" title="Index of all symbols">
<link rel="index" href="api-index-deprecated.html" title="Index of deprecated symbols">
<link rel="index" href="api-index-2-2.html" title="Index of new symbols in 2.2">
<link rel="index" href="api-index-2-4.html" title="Index of new symbols in 2.4">
<link rel="index" href="api-index-2-6.html" title="Index of new symbols in 2.6">
<link rel="index" href="api-index-2-8.html" title="Index of new symbols in 2.8">
<link rel="index" href="api-index-2-10.html" title="Index of new symbols in 2.10">
<link rel="index" href="api-index-2-12.html" title="Index of new symbols in 2.12">
<link rel="index" href="api-index-2-14.html" title="Index of new symbols in 2.14">
<link rel="appendix" href="apa.html" title="Appendix A. Porting applications from Imlib to gdk-pixbuf">
<link rel="appendix" href="license.html" title="Appendix B. License">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gdk-pixbuf-util.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="rn01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">The gdk-pixbuf Library</th>
<td><a accesskey="n" href="GdkPixbufLoader.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gdk-pixbuf-animation.synopsis" class="shortcut">Top</a>
                 | 
                <a href="#gdk-pixbuf-animation.description" class="shortcut">Description</a>
                 | 
                <a href="#gdk-pixbuf-animation.object-hierarchy" class="shortcut">Object Hierarchy</a>
</td></tr>
</table>
<div class="refentry" lang="en">
<a name="gdk-pixbuf-animation"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gdk-pixbuf-animation.top_of_page"></a>Animations</span></h2>
<p>Animations — Animated images.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gdk-pixbuf-animation.synopsis"></a><h2>Synopsis</h2>
<a name="GdkPixbufAnimation"></a><a name="GdkPixbufAnimationIter"></a><pre class="synopsis">

#include &lt;gdk-pixbuf/gdk-pixbuf.h&gt;

                    <a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimation-struct" title="GdkPixbufAnimation">GdkPixbufAnimation</a>;
                    <a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimationIter-struct" title="GdkPixbufAnimationIter">GdkPixbufAnimationIter</a>;
<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimation">GdkPixbufAnimation</a> * <a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-new-from-file" title="gdk_pixbuf_animation_new_from_file ()">gdk_pixbuf_animation_new_from_file</a> (const char *filename,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
>GError</a> **error);
<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimation">GdkPixbufAnimation</a> * <a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-ref" title="gdk_pixbuf_animation_ref ()">gdk_pixbuf_animation_ref</a>           (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimation">GdkPixbufAnimation</a> *animation);
void                <a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-unref" title="gdk_pixbuf_animation_unref ()">gdk_pixbuf_animation_unref</a>          (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimation">GdkPixbufAnimation</a> *animation);
int                 <a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-get-width" title="gdk_pixbuf_animation_get_width ()">gdk_pixbuf_animation_get_width</a>      (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimation">GdkPixbufAnimation</a> *animation);
int                 <a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-get-height" title="gdk_pixbuf_animation_get_height ()">gdk_pixbuf_animation_get_height</a>     (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimation">GdkPixbufAnimation</a> *animation);
<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimationIter">GdkPixbufAnimationIter</a> * <a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-get-iter" title="gdk_pixbuf_animation_get_iter ()">gdk_pixbuf_animation_get_iter</a>  (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimation">GdkPixbufAnimation</a> *animation,
                                                         const <a
href="/usr/share/gtk-doc/html/glib/glib-Date-and-Time-Functions.html#GTimeVal"
>GTimeVal</a> *start_time);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-is-static-image" title="gdk_pixbuf_animation_is_static_image ()">gdk_pixbuf_animation_is_static_image</a>
                                                        (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimation">GdkPixbufAnimation</a> *animation);
<a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *         <a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-get-static-image" title="gdk_pixbuf_animation_get_static_image ()">gdk_pixbuf_animation_get_static_image</a>
                                                        (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimation">GdkPixbufAnimation</a> *animation);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-iter-advance" title="gdk_pixbuf_animation_iter_advance ()">gdk_pixbuf_animation_iter_advance</a>   (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimationIter">GdkPixbufAnimationIter</a> *iter,
                                                         const <a
href="/usr/share/gtk-doc/html/glib/glib-Date-and-Time-Functions.html#GTimeVal"
>GTimeVal</a> *current_time);
int                 <a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-iter-get-delay-time" title="gdk_pixbuf_animation_iter_get_delay_time ()">gdk_pixbuf_animation_iter_get_delay_time</a>
                                                        (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimationIter">GdkPixbufAnimationIter</a> *iter);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-iter-on-currently-loading-frame" title="gdk_pixbuf_animation_iter_on_currently_loading_frame ()">gdk_pixbuf_animation_iter_on_currently_loading_frame</a>
                                                        (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimationIter">GdkPixbufAnimationIter</a> *iter);
<a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *         <a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-iter-get-pixbuf" title="gdk_pixbuf_animation_iter_get_pixbuf ()">gdk_pixbuf_animation_iter_get_pixbuf</a>
                                                        (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimationIter">GdkPixbufAnimationIter</a> *iter);

                    <a class="link" href="gdk-pixbuf-animation.html#GdkPixbufSimpleAnim" title="GdkPixbufSimpleAnim">GdkPixbufSimpleAnim</a>;
<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufSimpleAnim" title="GdkPixbufSimpleAnim">GdkPixbufSimpleAnim</a> * <a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-simple-anim-new" title="gdk_pixbuf_simple_anim_new ()">gdk_pixbuf_simple_anim_new</a>        (<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> width,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> height,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gfloat"
>gfloat</a> rate);
void                <a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-simple-anim-add-frame" title="gdk_pixbuf_simple_anim_add_frame ()">gdk_pixbuf_simple_anim_add_frame</a>    (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufSimpleAnim" title="GdkPixbufSimpleAnim">GdkPixbufSimpleAnim</a> *animation,
                                                         <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="gdk-pixbuf-animation.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  <a
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"
>GObject</a>
   +----GdkPixbufAnimation
</pre>
<pre class="synopsis">
  <a
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"
>GObject</a>
   +----GdkPixbufAnimationIter
</pre>
</div>
<div class="refsect1" lang="en">
<a name="gdk-pixbuf-animation.description"></a><h2>Description</h2>
<p>
    The <span class="application">gdk-pixbuf</span> library provides a simple mechanism to load and represent
    animations. An animation is conceptually a series of frames to be displayed
    over time. Each frame is the same size. The animation may not be represented
    as a series of frames internally; for example, it may be stored as a
    sprite and instructions for moving the sprite around a background. To display
    an animation you don't need to understand its representation, however; you just
    ask <span class="application">gdk-pixbuf</span> what should be displayed at a given point in time.
  </p>
</div>
<div class="refsect1" lang="en">
<a name="gdk-pixbuf-animation.details"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="GdkPixbufAnimation-struct"></a><h3>GdkPixbufAnimation</h3>
<pre class="programlisting">typedef struct _GdkPixbufAnimation GdkPixbufAnimation;</pre>
<p>
And opaque struct representing an animation.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="GdkPixbufAnimationIter-struct"></a><h3>GdkPixbufAnimationIter</h3>
<pre class="programlisting">typedef struct _GdkPixbufAnimationIter GdkPixbufAnimationIter;</pre>
<p>
And opaque struct representing an iterator which points to a
certain position in an animation.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-animation-new-from-file"></a><h3>gdk_pixbuf_animation_new_from_file ()</h3>
<pre class="programlisting"><a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimation">GdkPixbufAnimation</a> * gdk_pixbuf_animation_new_from_file (const char *filename,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
Creates a new animation by loading it from a file.  The file format is
detected automatically.  If the file's format does not support multi-frame
images, then an animation with a single frame will be created. Possible errors
are in the <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GDK-PIXBUF-ERROR--CAPS" title="GDK_PIXBUF_ERROR"><span class="type">GDK_PIXBUF_ERROR</span></a> and <a
href="/usr/share/gtk-doc/html/glib/glib-File-Utilities.html#G-FILE-ERROR--CAPS"
><span class="type">G_FILE_ERROR</span></a> domains.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td>
<td> Name of file to load, in the GLib file name encoding
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td> return location for error
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A newly-created animation with a reference count of 1, or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>
if any of several error conditions ocurred:  the file could not be opened,
there was no loader for the file's format, there was not enough memory to
allocate the image buffer, or the image file contained invalid data.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-animation-ref"></a><h3>gdk_pixbuf_animation_ref ()</h3>
<pre class="programlisting"><a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimation">GdkPixbufAnimation</a> * gdk_pixbuf_animation_ref           (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimation">GdkPixbufAnimation</a> *animation);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_pixbuf_animation_ref</code> is deprecated and should not be used in newly-written code. Use <a
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-ref"
><code class="function">g_object_ref()</code></a>.</p>
</div>
<p>
Adds a reference to an animation.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>animation</code></em> :</span></p></td>
<td> An animation.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The same as the <em class="parameter"><code>animation</code></em> argument.

</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-animation-unref"></a><h3>gdk_pixbuf_animation_unref ()</h3>
<pre class="programlisting">void                gdk_pixbuf_animation_unref          (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimation">GdkPixbufAnimation</a> *animation);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_pixbuf_animation_unref</code> is deprecated and should not be used in newly-written code. Use <a
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-unref"
><code class="function">g_object_unref()</code></a>.</p>
</div>
<p>
Removes a reference from an animation.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>animation</code></em> :</span></p></td>
<td> An animation.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-animation-get-width"></a><h3>gdk_pixbuf_animation_get_width ()</h3>
<pre class="programlisting">int                 gdk_pixbuf_animation_get_width      (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimation">GdkPixbufAnimation</a> *animation);</pre>
<p>
Queries the width of the bounding box of a pixbuf animation.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>animation</code></em> :</span></p></td>
<td> An animation.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> Width of the bounding box of the animation.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-animation-get-height"></a><h3>gdk_pixbuf_animation_get_height ()</h3>
<pre class="programlisting">int                 gdk_pixbuf_animation_get_height     (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimation">GdkPixbufAnimation</a> *animation);</pre>
<p>
Queries the height of the bounding box of a pixbuf animation.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>animation</code></em> :</span></p></td>
<td> An animation.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> Height of the bounding box of the animation.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-animation-get-iter"></a><h3>gdk_pixbuf_animation_get_iter ()</h3>
<pre class="programlisting"><a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimationIter">GdkPixbufAnimationIter</a> * gdk_pixbuf_animation_get_iter  (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimation">GdkPixbufAnimation</a> *animation,
                                                         const <a
href="/usr/share/gtk-doc/html/glib/glib-Date-and-Time-Functions.html#GTimeVal"
>GTimeVal</a> *start_time);</pre>
<p>
Get an iterator for displaying an animation. The iterator provides
the frames that should be displayed at a given time.
It should be freed after use with <a
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-unref"
><code class="function">g_object_unref()</code></a>.
</p>
<p>
<em class="parameter"><code>start_time</code></em> would normally come from <a
href="/usr/share/gtk-doc/html/glib/glib-Date-and-Time-Functions.html#g-get-current-time"
><code class="function">g_get_current_time()</code></a>, and
marks the beginning of animation playback. After creating an
iterator, you should immediately display the pixbuf returned by
<a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-iter-get-pixbuf" title="gdk_pixbuf_animation_iter_get_pixbuf ()"><code class="function">gdk_pixbuf_animation_iter_get_pixbuf()</code></a>. Then, you should install a
timeout (with <a
href="/usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#g-timeout-add"
><code class="function">g_timeout_add()</code></a>) or by some other mechanism ensure
that you'll update the image after
<a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-iter-get-delay-time" title="gdk_pixbuf_animation_iter_get_delay_time ()"><code class="function">gdk_pixbuf_animation_iter_get_delay_time()</code></a> milliseconds. Each time
the image is updated, you should reinstall the timeout with the new,
possibly-changed delay time.
</p>
<p>
As a shortcut, if <em class="parameter"><code>start_time</code></em> is <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>, the result of
<a
href="/usr/share/gtk-doc/html/glib/glib-Date-and-Time-Functions.html#g-get-current-time"
><code class="function">g_get_current_time()</code></a> will be used automatically.
</p>
<p>
To update the image (i.e. possibly change the result of
<a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-iter-get-pixbuf" title="gdk_pixbuf_animation_iter_get_pixbuf ()"><code class="function">gdk_pixbuf_animation_iter_get_pixbuf()</code></a> to a new frame of the animation),
call <a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-iter-advance" title="gdk_pixbuf_animation_iter_advance ()"><code class="function">gdk_pixbuf_animation_iter_advance()</code></a>.
</p>
<p>
If you're using <a class="link" href="GdkPixbufLoader.html" title="GdkPixbufLoader"><span class="type">GdkPixbufLoader</span></a>, in addition to updating the image
after the delay time, you should also update it whenever you
receive the area_updated signal and
<a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-iter-on-currently-loading-frame" title="gdk_pixbuf_animation_iter_on_currently_loading_frame ()"><code class="function">gdk_pixbuf_animation_iter_on_currently_loading_frame()</code></a> returns
<a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a>. In this case, the frame currently being fed into the loader
has received new data, so needs to be refreshed. The delay time for
a frame may also be modified after an area_updated signal, for
example if the delay time for a frame is encoded in the data after
the frame itself. So your timeout should be reinstalled after any
area_updated signal.
</p>
<p>
A delay time of -1 is possible, indicating "infinite."</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>animation</code></em> :</span></p></td>
<td> a <a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimation"><span class="type">GdkPixbufAnimation</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>start_time</code></em> :</span></p></td>
<td> time when the animation starts playing
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> an iterator to move over the animation
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-animation-is-static-image"></a><h3>gdk_pixbuf_animation_is_static_image ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            gdk_pixbuf_animation_is_static_image
                                                        (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimation">GdkPixbufAnimation</a> *animation);</pre>
<p>
If you load a file with <a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-new-from-file" title="gdk_pixbuf_animation_new_from_file ()"><code class="function">gdk_pixbuf_animation_new_from_file()</code></a> and it turns
out to be a plain, unanimated image, then this function will return
<a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a>. Use <a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-get-static-image" title="gdk_pixbuf_animation_get_static_image ()"><code class="function">gdk_pixbuf_animation_get_static_image()</code></a> to retrieve
the image.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>animation</code></em> :</span></p></td>
<td> a <a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimation"><span class="type">GdkPixbufAnimation</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a> if the "animation" was really just an image
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-animation-get-static-image"></a><h3>gdk_pixbuf_animation_get_static_image ()</h3>
<pre class="programlisting"><a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *         gdk_pixbuf_animation_get_static_image
                                                        (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimation">GdkPixbufAnimation</a> *animation);</pre>
<p>
If an animation is really just a plain image (has only one frame),
this function returns that image. If the animation is an animation,
this function returns a reasonable thing to display as a static
unanimated image, which might be the first frame, or something more
sophisticated. If an animation hasn't loaded any frames yet, this
function will return <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>animation</code></em> :</span></p></td>
<td> a <a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimation"><span class="type">GdkPixbufAnimation</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> unanimated image representing the animation
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-animation-iter-advance"></a><h3>gdk_pixbuf_animation_iter_advance ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            gdk_pixbuf_animation_iter_advance   (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimationIter">GdkPixbufAnimationIter</a> *iter,
                                                         const <a
href="/usr/share/gtk-doc/html/glib/glib-Date-and-Time-Functions.html#GTimeVal"
>GTimeVal</a> *current_time);</pre>
<p>
Possibly advances an animation to a new frame. Chooses the frame based
on the start time passed to <a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-get-iter" title="gdk_pixbuf_animation_get_iter ()"><code class="function">gdk_pixbuf_animation_get_iter()</code></a>.
</p>
<p>
<em class="parameter"><code>current_time</code></em> would normally come from <a
href="/usr/share/gtk-doc/html/glib/glib-Date-and-Time-Functions.html#g-get-current-time"
><code class="function">g_get_current_time()</code></a>, and
must be greater than or equal to the time passed to
<a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-get-iter" title="gdk_pixbuf_animation_get_iter ()"><code class="function">gdk_pixbuf_animation_get_iter()</code></a>, and must increase or remain
unchanged each time <a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-iter-get-pixbuf" title="gdk_pixbuf_animation_iter_get_pixbuf ()"><code class="function">gdk_pixbuf_animation_iter_get_pixbuf()</code></a> is
called. That is, you can't go backward in time; animations only
play forward.
</p>
<p>
As a shortcut, pass <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a> for the current time and <a
href="/usr/share/gtk-doc/html/glib/glib-Date-and-Time-Functions.html#g-get-current-time"
><code class="function">g_get_current_time()</code></a>
will be invoked on your behalf. So you only need to explicitly pass
<em class="parameter"><code>current_time</code></em> if you're doing something odd like playing the animation
at double speed.
</p>
<p>
If this function returns <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE--CAPS"
><code class="literal">FALSE</code></a>, there's no need to update the animation
display, assuming the display had been rendered prior to advancing;
if <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a>, you need to call <code class="function">gdk_animation_iter_get_pixbuf()</code> and update the
display with the new pixbuf.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
<td> a <a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimationIter"><span class="type">GdkPixbufAnimationIter</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>current_time</code></em> :</span></p></td>
<td> current time
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a> if the image may need updating

</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-animation-iter-get-delay-time"></a><h3>gdk_pixbuf_animation_iter_get_delay_time ()</h3>
<pre class="programlisting">int                 gdk_pixbuf_animation_iter_get_delay_time
                                                        (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimationIter">GdkPixbufAnimationIter</a> *iter);</pre>
<p>
Gets the number of milliseconds the current pixbuf should be displayed,
or -1 if the current pixbuf should be displayed forever. <a
href="/usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#g-timeout-add"
><code class="function">g_timeout_add()</code></a>
conveniently takes a timeout in milliseconds, so you can use a timeout
to schedule the next update.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
<td> an animation iterator
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> delay time in milliseconds (thousandths of a second)
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-animation-iter-on-currently-loading-frame"></a><h3>gdk_pixbuf_animation_iter_on_currently_loading_frame ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            gdk_pixbuf_animation_iter_on_currently_loading_frame
                                                        (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimationIter">GdkPixbufAnimationIter</a> *iter);</pre>
<p>
Used to determine how to respond to the area_updated signal on
<a class="link" href="GdkPixbufLoader.html" title="GdkPixbufLoader"><span class="type">GdkPixbufLoader</span></a> when loading an animation. area_updated is emitted
for an area of the frame currently streaming in to the loader. So if
you're on the currently loading frame, you need to redraw the screen for
the updated area.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
<td> a <a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimationIter"><span class="type">GdkPixbufAnimationIter</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a> if the frame we're on is partially loaded, or the last frame
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-animation-iter-get-pixbuf"></a><h3>gdk_pixbuf_animation_iter_get_pixbuf ()</h3>
<pre class="programlisting"><a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *         gdk_pixbuf_animation_iter_get_pixbuf
                                                        (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufAnimationIter">GdkPixbufAnimationIter</a> *iter);</pre>
<p>
Gets the current pixbuf which should be displayed; the pixbuf will
be the same size as the animation itself
(<a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-get-width" title="gdk_pixbuf_animation_get_width ()"><code class="function">gdk_pixbuf_animation_get_width()</code></a>, <a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-get-height" title="gdk_pixbuf_animation_get_height ()"><code class="function">gdk_pixbuf_animation_get_height()</code></a>). 
This pixbuf should be displayed for 
<a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-iter-get-delay-time" title="gdk_pixbuf_animation_iter_get_delay_time ()"><code class="function">gdk_pixbuf_animation_iter_get_delay_time()</code></a> milliseconds.  The caller
of this function does not own a reference to the returned pixbuf;
the returned pixbuf will become invalid when the iterator advances
to the next frame, which may happen anytime you call
<a class="link" href="gdk-pixbuf-animation.html#gdk-pixbuf-animation-iter-advance" title="gdk_pixbuf_animation_iter_advance ()"><code class="function">gdk_pixbuf_animation_iter_advance()</code></a>. Copy the pixbuf to keep it
(don't just add a reference), as it may get recycled as you advance
the iterator.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
<td> an animation iterator
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the pixbuf to be displayed
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="GdkPixbufSimpleAnim"></a><h3>GdkPixbufSimpleAnim</h3>
<pre class="programlisting">typedef struct _GdkPixbufSimpleAnim GdkPixbufSimpleAnim;</pre>
<p>
An
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-simple-anim-new"></a><h3>gdk_pixbuf_simple_anim_new ()</h3>
<pre class="programlisting"><a class="link" href="gdk-pixbuf-animation.html#GdkPixbufSimpleAnim" title="GdkPixbufSimpleAnim">GdkPixbufSimpleAnim</a> * gdk_pixbuf_simple_anim_new        (<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> width,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> height,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gfloat"
>gfloat</a> rate);</pre>
<p>
Creates a new, empty animation.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
<td> the width of the animation
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
<td> the height of the animation
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>rate</code></em> :</span></p></td>
<td> the speed of the animation, in frames per second
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a newly allocated <a class="link" href="gdk-pixbuf-animation.html#GdkPixbufSimpleAnim" title="GdkPixbufSimpleAnim"><span class="type">GdkPixbufSimpleAnim</span></a> 

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.8</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-simple-anim-add-frame"></a><h3>gdk_pixbuf_simple_anim_add_frame ()</h3>
<pre class="programlisting">void                gdk_pixbuf_simple_anim_add_frame    (<a class="link" href="gdk-pixbuf-animation.html#GdkPixbufSimpleAnim" title="GdkPixbufSimpleAnim">GdkPixbufSimpleAnim</a> *animation,
                                                         <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);</pre>
<p>
Adds a new frame to <em class="parameter"><code>animation</code></em>. The <em class="parameter"><code>pixbuf</code></em> must
have the dimensions specified when the animation 
was constructed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>animation</code></em> :</span></p></td>
<td> a <a class="link" href="gdk-pixbuf-animation.html#GdkPixbufSimpleAnim" title="GdkPixbufSimpleAnim"><span class="type">GdkPixbufSimpleAnim</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>pixbuf</code></em> :</span></p></td>
<td> the pixbuf to add 
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.8</p>
</div>
</div>
<div class="refsect1" lang="en">
<a name="gdk-pixbuf-animation.see-also"></a><h2>See Also</h2>
<p>
    <a class="link" href="GdkPixbufLoader.html" title="GdkPixbufLoader"><span class="type">GdkPixbufLoader</span></a>
  </p>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.11</div>
</body>
</html>
